﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Movie.Master" AutoEventWireup="true" CodeBehind="Search.aspx.cs" Inherits="MovieWebApp.Pages.Search" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<asp:Label ID="lblAdvanced" Text = "<%$ Resources:WebResources, pagAdvancedSearch %>" style = "color:Black"
runat = "server" />

<asp:Panel ID = "FilteredSearch" runat = "server"
GroupingText = "<%$ Resources:WebResources, panFilteredSearch %>" Width = "700px">
<table>
    <tr>
        <td>
            <asp:Label ID = "lblSearch" style = "color:Black"
                Text = "<%$ Resources:WebResources, Search %>" runat = "server" />
        </td>
        <td>
            <asp:TextBox ID = "boxSearch" runat = "server" />
        </td>
    </tr>
    
    <tr>
        <td>
            <asp:Label ID = "lblFilter" style = "color:Black"
                Text = "<%$ Resources:WebResources, lblFilter %>" runat = "server" /></td>
                <td><asp:DropDownList ID = "ddlFilter" AutoPostBack = "true"
                runat = "server" OnSelectedIndexChanged = "ddlFilter_SelectedIndexChanged"
                DataTextField = "name" DataValueField = "id">
                
                <asp:ListItem Value="NONE">No filter</asp:ListItem>
                <asp:ListItem Value="MOVIETITLE">Title</asp:ListItem>
                <asp:ListItem Value="PRODUCTIONSTUDIO">Studio</asp:ListItem>
                <asp:ListItem Value="MOVIEDESC">Description</asp:ListItem>
                <asp:ListItem Value="GENRE">Genre</asp:ListItem>
                <asp:ListItem Value="ACTORS">Actors</asp:ListItem>
                <asp:ListItem Value="ACTRESSES">Actresses</asp:ListItem>
                        
                </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td>
            <asp:Button ID = "btnSubmit" runat = "server"
                Text = "<%$ Resources:WebResources, Submit %>" onclick="btnSubmit_Click" />
        </td>
    </tr>
    
</table>
</asp:Panel>

<asp:DataList RepeatLayout = "Table" RepeatColumns = "4" CellPadding = "20"
    RepeatDirection = "Horizontal" ItemStyle-BorderStyle = "Double"
    runat = "server" ID = "pList" 
    onselectedindexchanged="pList_SelectedIndexChanged">
    <ItemTemplate>
         <asp:Image ID = "mveImage" runat = "server"
         ImageUrl = '<%# Eval("movieImage", "~/Images/{0}") %>'/>

        <%# DataBinder.Eval(Container.DataItem, "movieTitle") %><br />
        <%# DataBinder.Eval(Container.DataItem, "movieDesc") %><br />
        <%# String.Format("{0:c}",Convert.ToDecimal
        (DataBinder.Eval(Container.DataItem, "listPrice")))%><br />
        <asp:LinkButton ID = "AddToCart" CommandName = '<%#Container.ItemIndex %>' 
            runat = "server" OnClick = "AddToCartLink">Add To Cart</asp:LinkButton>       
    </ItemTemplate>
</asp:DataList>
</asp:Content>